<script setup>
import { ref } from 'vue';

const show = ref(false);
const toggle = () => (show.value = !show.value);

const count = ref(0);
const increment = () => count.value++;
</script>

<template>
  <div><button @click="toggle">显示/隐藏</button><img v-show="show" src="" alt="这是一张图片" /></div>
  <div>计数器：{{ count }} <button @click="increment">累加</button></div>
</template>
